import java.util.Arrays;

public class Leet300 {
    public static void main(String[] args) {
        System.out.println(lengthOfLIS(new int[]{0,1,0,3,2,3}));
    }
    static public int lengthOfLIS(int[] nums) {
        int[] dp = new int[nums.length];
        Arrays.fill(dp, 1);
        for (int i = 1; i < dp.length; i++)
            for (int j = i-1; j >=0; j--)
                if (nums[j]<nums[i])
                    dp[i] = Math.max(dp[j]+1,dp[i]);
        Arrays.sort(dp);
        return dp[dp.length-1];
    }
}
